package com.egoo.ticket.server.dao;

import com.egoo.ticket.server.pojo.dto.WorkOrderLogDto;
import com.egoo.ticket.server.pojo.entity.WorkOrderLog;
import com.egoo.ticket.server.pojo.vo.WorkOrderLogVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * @author Administrator
 */
@Component
public interface WorkOrderLogDao {
	/**
	 * 查询工单log列表
	 * @param workOrderLogDto
	 * @return
	 */
	List<WorkOrderLogVo> selectWorkOrderLogList(WorkOrderLogDto workOrderLogDto);

	/**
	 * 通过工单id和log类型获取对应log
	 * @param workOrderId
	 * @param logType
	 * @return
	 */
	WorkOrderLogVo selectByWorkOrderIdAndLogType(@Param(value = "workOrderId") String workOrderId,
                                                 @Param(value = "logType") String logType);

	/**
	 * 删除
	 * @param id
	 * @return
	 */
	Integer deleteByPrimaryKey(String id);

	/**
	 * 插入
	 * @param record
	 * @return
	 */
	Integer insert(WorkOrderLog record);

	/**
	 * 批量插入
	 * @param list
	 * @return
	 */
	Integer insertBatch(List<WorkOrderLog> list);

	/**
	 * 动态插入
	 * @param record
	 * @return
	 */
	@Deprecated
	Integer insertSelective(WorkOrderLog record);

	/**
	 * 查询对应主键的log
	 * @param id
	 * @return
	 */
	WorkOrderLogVo selectByPrimaryKey(String id);

	/**
	 * 动态更新
	 * @param record
	 * @return
	 */
	Integer updateByPrimaryKeySelective(WorkOrderLog record);

	/**
	 * 更新
	 * @param record
	 * @return
	 */
	Integer updateByPrimaryKey(WorkOrderLog record);

	/**
	 * 通过工单id更新log的处理状态
	 * @param record
	 * @return
	 */
	Integer updateHandleStateByWorkOrderId(WorkOrderLog record);

	/**
	 * 查询催单记录
	 * @param workOrderLog
	 * @return
	 */
	Integer selectUrgeLog(WorkOrderLog workOrderLog);
	/**
	 * TODO 根据工单id获取工单所有操作日志
	 * @author: victor_tang
	 * @createtime: 2020/9/1 14:52
	 * @param workOrderId 1
	 * @return: java.util.List<com.egoo.ews.service.pojo.vo.WorkOrderLogVo>
	 */
	List<WorkOrderLogVo> selectLogByWorkOrderId(String workOrderId);
}